/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("base_processline",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.AspNetCore.Http;
using VOL.Entity.DomainModels;
using IMES.BaseData.IServices;
using IMES.BaseData.IRepositories;
using Microsoft.EntityFrameworkCore;

namespace IMES.BaseData.Controllers
{
    public partial class base_processlineController
    {
        private readonly Ibase_processlineService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;
        private readonly Ibase_processlinelistRepository _linelistRepository;

        [ActivatorUtilitiesConstructor]
        public base_processlineController(
            Ibase_processlineService service,
            IHttpContextAccessor httpContextAccessor,
            Ibase_processlinelistRepository linelistRepository
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
            _linelistRepository = linelistRepository;
        }
        /// <summary>
        /// 获取工序数据集采集列表
        /// </summary>
        /// <param name="processline_id"></param>
        /// <returns></returns>
        [Route("getDetailRows"),HttpGet]
        public async Task<IActionResult> GetDetailRows(int processline_id)
        {
            var rows = await _linelistRepository.FindAsIQueryable(x => x.processline_id == processline_id).ToListAsync();
            return JsonNormal(rows);

        }
    }
}
